
// import { cateList } from '@/request/api'
//声明state
const state = {
    theme: 'roma',//白色主题
}

//修改state
const mutations = {
    changeTheme(state, isShow) {
        if (isShow) {
            state.theme = 'roma';//白色主题
        } else {
            state.theme = 'dark';//黑色主题
        }
    }
}


const actions = {
    themeActions(context, isShow) {
        // 提交mutaions
        context.commit('changeTheme', isShow)
    }
}


//派生状态
const getters = {
    theme(state) {
        return state.theme
    }
}


export default {
    state,
    mutations,
    actions,
    getters,
    namespaced: true,   //启用命名空间
}